import request from '@/utils/request';

/**
 * 获取轮播列表
 * @returns {Promise<any>}
 */
export const getSlideData = async (data,page) => {
  const options = {
    params: data
  }
  return request(`/admin/slides?page=` + page,options);
}
/**
 * 添加轮播
 * @returns {Promise<any>}
 */
export const addSlide = async (data) => {
  return request.post('/admin/slides', {data});
}
/**
 * 更新轮播
 * @returns {Promise<any>}
 */
export const editSlide = async (id,data) => {
  return request.put(`/admin/slides/${id}`,{data});
}
/**
 * 轮播详情
 * @returns {Promise<any>}
 */
export const getSlideDetail = async (id) => {
  return request.get(`/admin/slides/${id}`);
}
/**
 * 删除轮播
 * @returns {Promise<any>}
 */
export const delSlide = async (id) => {
  return request.delete(`/admin/slides/${id}`);
}
/**
 *改变轮播状态
 * @returns {Promise<any>}
 */
export const editSlideStatus = async (id) => {
  return request.patch(`/admin/slides/${id}/status`);
}

